<?php
namespace app\admin\model;
use think\Loader;
use think\Model;
use think\Validate;

class CardModel extends Model
{
    protected $pk = 'id';//主键
    //设置当前模型对应的完整数据表名称
    protected $table = 'fly_card';
    //后台用户中心数据
    public function cardList()
    {
    	$cardList = db('card')
                    ->alias('c')
                    ->field('c.*,cate.*,c.create_time ccreate_time,c.id cid')
                    ->join('fly_category cate','cate.id=c.category_id')
                    ->select();
    	// dump($cardList);die;
    	return $cardList;
    }
    //帖子总数
    public function total()
    {
        $cardTotal = $this->count();
        return $cardTotal;
    }
   
}